Conditions | 1 |
Paths | 1 |
Total Lines | 31 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | "use strict"; |
||
15 | let createWindow = () => { |
||
16 | let mainWindow; |
||
17 | |||
18 | mainWindow = new BrowserWindow({ |
||
19 | width: 800, |
||
20 | height: 600 |
||
21 | }); |
||
22 | |||
23 | mainWindow.maximize(); |
||
24 | |||
25 | mainWindow.loadURL(url.format({ |
||
26 | pathname: path.join(__dirname, '../views/index.html'), |
||
27 | protocol: 'file:', |
||
28 | slashes: true |
||
29 | })); |
||
30 | |||
31 | mainWindow.webContents.on('new-window', (event, url) => { |
||
32 | event.preventDefault(); |
||
33 | open(url); |
||
34 | }); |
||
35 | |||
36 | // Open the DevTools. |
||
37 | mainWindow.webContents.openDevTools(); |
||
38 | |||
39 | touchbar.setMainWindow(mainWindow); |
||
40 | mainWindow.setTouchBar(touchbar.touchBar); |
||
41 | |||
42 | mainWindow.on('closed', () => { |
||
43 | mainWindow = null; |
||
44 | }); |
||
45 | }; |
||
46 | |||
50 |